package com.wushi.lenovo.asia5b.app_di.profile.presenter;

import android.text.TextUtils;

import com.mvp.base.BasePresenter;
import com.wushi.lenovo.asia5b.app_di.profile.mvpview.CheckEmailActivityView;
import com.wushi.lenovo.asia5b.app_http.ApiService;

import javax.inject.Inject;

/**
 * Created by zhangyuncai on 2018/12/8.
 */
public class CheckEmailActivityPresenter extends BasePresenter<CheckEmailActivityView> {

    ApiService apiService;

    @Inject
    public CheckEmailActivityPresenter(ApiService apiService) {
        this.apiService = apiService;
    }

    public void checkEmail(String email) {
        if (TextUtils.isEmpty(email)) {
            return;
        }

        baseSubscribe(apiService.checkEmail(email),
                resultModel -> {
                    getView().checkEmailResult(resultModel,email);
                });

    }

}